<template>
    <div class="my-collection">
        <tabs :options="tabs" v-model="tabActive" @onclick="handleNavClick"/>
        <router-view/>
    </div>
</template>

<style lang="less">
    @import '../../../style/variable';
    .my-collection{
        .van-tab {
            flex-basis: 20%;
        }
    }
</style>

<script>
    export default {
        data(){
            return {
                tabs: ['资讯', '报价', '金融圈', '智库', '职位'],
                tabActive: 0,
            }
        },
        created(){
            this.$store.commit('hideNav', true);
        },
        methods: {
            handleNavClick(key){
                const navRoutes = ['/user/myCollection', '/user/myCollection/quote', '/user/myCollection/circle', '/user/myCollection/think', '/user/myCollection/job'];
                this.$router.replace(navRoutes[key]);
            }
        }
    }
</script>